//
//  GPSearchListCell.m
//  gupiao
//
//  Created by mac on 2019/8/15.
//  Copyright © 2019 mac. All rights reserved.
//

#import "GPSearchListCell.h"
#import "DGPUtil.h"

#import "HHYZXStockLocalModel.h"

@implementation GPSearchListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (IBAction)addAction:(id)sender {
    HHYZXStockLocalModel *addModel = [[HHYZXStockLocalModel alloc] init];
    addModel.symbol = self.model.gid;
    addModel.name = self.model.name;
    addModel.trade = self.model.todayStartPri;
    addModel.changepercent = self.model.increPer;
    addModel.buy = self.model.competitivePri;
    addModel.sell = self.model.reservePri;
    addModel.userID = [DGPUtil getCurrentUserID];
    addModel.createTime = [[NSDate date] timeIntervalSince1970];
    [DGPUtil addZiXuanModel:addModel successCallback:^{
        [MBProgressHUD showInformation:@"已添加到“自选”" toView:WINDOW andAfterDelay:HUD_TIME];
    } failedCallback:^{
        [MBProgressHUD showInformation:@"已添加到”自选“" toView:WINDOW andAfterDelay:HUD_TIME];
    }];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
